package pri.syl.xiaowu.websocket.netty.core.factory.execution;

import java.util.concurrent.ThreadPoolExecutor;

/**
 * @Author YunLong
 * @Date 2021/7/18 18:54
 * @Description 线程池执行器
 **/
public class ThreadPoolFactoryExecution {
    private ThreadPoolFactoryExecution() {
    }

    public static void statsThread(ThreadPoolExecutor threadPoolExecutor, Runnable runnable) {
        threadPoolExecutor.execute(runnable);
    }

    public static void statsThreadAndShutdown(ThreadPoolExecutor threadPoolExecutor, Runnable runnable) {
        threadPoolExecutor.execute(runnable);
        threadPoolExecutor.shutdown();
    }
}
